<template>
  <div class="w-full flex flex-col h-full gap-6">
    <input v-model="memo.title" type="text" class="rounded-3xl outline-none p-4" placeholder="请输入标题">
    <textarea v-model="memo.content" class="rounded-3xl h-full outline-none p-4" placeholder="请输入内容" />
    <button class="rounded-full bg-[#F5A99F] text-white p-4 px-16 " @click="handleSubmit">
      确定
    </button>
  </div>
</template>

<script setup>
const memo = reactive({
  title: '',
  content: ''
})
const router = useRouter()
async function handleSubmit () {
  await useFetch('/api/memo', { method: 'POST', body: memo })
  router.push('/memo')
}
</script>
